

#include <libplayerc++/playerc++.h>


using namespace std;
using namespace PlayerCc;
int main(int argc, char** argv){

//ROBOT SECONDARIO
	PlayerClient robot1("localhost", 6665);   //This is needed in every player client application
        Position2dProxy pp1(&robot1, 0);     //This is needed in every player client application

        BlobfinderProxy bp1(&robot1,0);


robot1.Read();

         int NBlob=bp1.GetCount();        
        playerc_blobfinder_blob_t ListaBlob[NBlob];             
                
                for (int z=0; z<NBlob;z++){
                             playerc_blobfinder_blob_t blob=bp1.GetBlob(z);
                                ListaBlob[z]=blob;
                }


              printf("lacacca con id %d vede %d blobbi\n",robot1.GetPort(),NBlob);
              std::string scol= "nessun colore";
for (int i=0; i<NBlob;i++){
     playerc_blobfinder_blob_t b = ListaBlob[i];
     int col= b.color;       
               printf("numero ID %d blob\n",b.color);
	if(col==65280)
              scol="verde";
        if(col==255)
            scol="blue";
     if(col==16711935)
              scol="magenta";
	 if(col==100)
              scol="rosso";
 	if(col==0)
              scol="nero";
         std::cout << "colre del blobb " + scol << std::endl;
                     //printf("il colore del blobb %s \n", scol);    
  }

      }
